package com.scarecrow.olga.tracking {
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	/**
	 * ...
	 * @author Santiago.J.Elizalde
	 */
	public class GameTracker {
		
		private static var gameEventCounters:Object;
		private static var dispatcher:IEventDispatcher;
		
		public function GameTracker() {
			
		}
		
		/**
		 * Initializes the tracker with the desired dispatcher object. Flash's EventDispatcher will be used if none is specified.
		 * An object with initialization values for event counters can also be passed. The event counts will be set to the initObject's
		 * values for each key contained in it.
		 * 
		 * @param	eventDispatcher dispatcher object to use as game event dispatcher.
		 * @param	initValues map of initial counter values to assign to event counts.
		 */
		public static function initialize(eventDispatcher:IEventDispatcher = null, initValues:Object = null):void {
			dispatcher = eventDispatcher || new EventDispatcher();
			gameEventCounters = new Object();
			if (initValues) {
				for (var name:String in initValues) {
					gameEventCounters[name] = initValues[name];
				}
			}
		}
		
		public static function get dispatcher():IEventDispatcher {
			
		}
		
		public static function track(event:String):void {
			if (!gameEventCounters[event]) {
				gameEventCounters[event] = 1;
			} else {
				gameEventCounters[event]++
			}
		}
		
		public static function getEventCount(event:String):uint {
			
		}
	}

}